import org.junit.jupiter.api.Test;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class timeParse {
    @Test
    void test() {
        //localDateTime转换器
        DateTimeFormatter dateTimeFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String time = "2022-12-17 23:59:59";
        LocalDateTime parse = LocalDateTime.parse(time, dateTimeFormat);
        System.out.println(parse);
        Long number = 12323948L;
        String numberTemp = String.valueOf(number);
        System.out.println(numberTemp);
        System.out.println(numberTemp instanceof String);
    }

    @Test
    void compareLocalDateTime() throws InterruptedException {
        LocalDateTime now1 = LocalDateTime.now();
        Thread.sleep(500);
        LocalDateTime now2 = LocalDateTime.now();
        System.out.println(now1.compareTo(now2));
    }
}
